package com.foreveross.ehcache;

import java.io.Serializable;

import com.foreveross.crawl.vo.TaskModelBeta1;

public class TaskCacheVO implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3310441698066205458L;
	private TaskModelBeta1 task;
	private String jobName;
	private String groupName;
	private String taskState;
	
	public TaskCacheVO(){
		
	}
	
	public TaskCacheVO(TaskModelBeta1 task, String taskState){
		this.task = task;
		this.taskState = taskState;
	}
	public TaskCacheVO(TaskModelBeta1 task, String taskState, String jobName, String groupName){
		this.task = task;
		this.taskState = taskState;
		this.jobName = jobName;
		this.groupName = groupName;
	}

	public TaskModelBeta1 getTask() {
		return task;
	}

	public void setTask(TaskModelBeta1 task) {
		this.task = task;
	}

	public String getJobName() {
		return jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	public String getTaskState() {
		return taskState;
	}

	public void setTaskState(String taskState) {
		this.taskState = taskState;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((groupName == null) ? 0 : groupName.hashCode());
		result = prime * result + ((jobName == null) ? 0 : jobName.hashCode());
		result = prime * result + ((task == null) ? 0 : task.hashCode());
		result = prime * result
				+ ((taskState == null) ? 0 : taskState.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TaskCacheVO other = (TaskCacheVO) obj;
		if (groupName == null) {
			if (other.groupName != null)
				return false;
		} else if (!groupName.equals(other.groupName))
			return false;
		if (jobName == null) {
			if (other.jobName != null)
				return false;
		} else if (!jobName.equals(other.jobName))
			return false;
		if (task == null) {
			if (other.task != null)
				return false;
		} else if (!task.equals(other.task))
			return false;
		if (taskState == null) {
			if (other.taskState != null)
				return false;
		} else if (!taskState.equals(other.taskState))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "TaskCacheVO [task=" + task + ", jobName=" + jobName
				+ ", groupName=" + groupName + ", taskState=" + taskState + "]";
	}

}
